package com.easycms.framework.shiro.stateless;

import com.easycms.framework.shiro.UserOwnInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.springframework.beans.BeanWrapperImpl;
import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.PropertyValue;
import org.springframework.beans.PropertyValues;
import org.springframework.validation.DataBinder;

import java.util.HashMap;
import java.util.Map;

/**
 * @author yushuo
 * @className
 * @descripton TODO
 * @date 2021/2/8 10:31
 **/
public class StatelessToken implements AuthenticationToken {
    private UserOwnInfo userCookie;


    public StatelessToken(UserOwnInfo userOwnInfo) {
        this.userCookie = userOwnInfo;

    }

    public UserOwnInfo getUserCookie() {
        return this.userCookie;
    }

    public void setUserCookie(UserOwnInfo userOwnInfo) {
        this.userCookie = userCookie;
    }

    public String  getUserName() {
        return this.userCookie.getUserName();
    }
    @Override
    public Object getPrincipal() {
        return this.userCookie.getLoginName();
    }

    @Override
    public Object getCredentials() {
        return this.userCookie.getUserName();
    }

}
